package com.example.feitiansys.service.attendance.impl;

import com.example.feitiansys.mapper.AttendanceDao;
import com.example.feitiansys.pojo.Attendance;
import com.example.feitiansys.pojo.Leave;
import com.example.feitiansys.service.attendance.AttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 打卡表(Attendance)表时间接口
 * @author makejava
 * @Date 2021-11-03-9:44
 */
@Service
@Transactional
public class AttendanceServiceImpl implements AttendanceService {
    @Autowired
    AttendanceDao attendanceDao;

    @Override
    public Attendance queryById(Integer id) {
        return attendanceDao.queryById(id);
    }

    @Override
    public List<Attendance> queryAllByLimit(int offset, int limit) {
        return attendanceDao.queryAllByLimit(offset,limit);
    }

    @Override
    public List<Attendance> queryAll(Attendance attendance) {
        return attendanceDao.queryAll(attendance);
    }

    @Override
    public int insert(Attendance attendance) {
        return attendanceDao.insert(attendance);
    }

    @Override
    public int update(Attendance attendance) {
        return attendanceDao.update(attendance);
    }

    @Override
    public boolean deleteById(Integer id) {
        return attendanceDao.deleteById(id)>0;
    }

    @Override
    public boolean deleteByIds(Object array) {

        return attendanceDao.deleteAttenByIds(array)>0;
    }
}
